Waw of joining
جَاءَ زَيْدٌ وَبَكْرٌ
Zayd and Bakr came. زَيْدٌ and بَكْرٌ share the role of subject.
Waw of accompaniment
جَاءَ زَيْدٌ وَبَكْرًا
Zayd came with Bakr. زَيْدٌ is the subject, while بَكْرًا is the accompanying mansub noun.
Do not decide from waw alone. Read the intended meaning and the case of the following noun together.