I'm not a network guy so I can't speak to the physical swtich configuration, but on ESXi, you set the VLAN id on each port group on your virtual switch. Your Management Network vmk, vMotion vmk, and all VM portgroups can have unique VLAN id's set. On your switch, you enable dot1q on your ESXi uplink ports and allow the correct vlans access to that port. In ESXi, the virtual switch (or the guest network adapter in the VM, if you prefer) takes care of the VLAN tagging.
Please read the following KB for more detail: