Hosts do not know whether they are connected to directly to another host, or to a switch, or to two switches. They only know who the other party is they want to speak to, not what devices may or may not exist in between.
After having completed the ARP process, the host will be able to create a packet with a L2 header that includes a destination MAC address of the other host.
The switch will then behave as follows:
 where Host B's MAC address exists.
Had the initial frame been a broadcast, which is to say a frame destined to the MAC address `ffff.ffff.ffff`, the effect would have been the same -- the switch would have flooded the frame.