Hi steve! you can tag VLANs without problems. In VMware you have two types of virtual switches. Standard Switch and Distributed Switch (Requires enterprise license). Distributed switch lets you manage all hosts networking from the same console, so I would highly recommend it you have the licenses and you are using clusters.
Since you are using Standard Switch, let me help you with that. You would need to go to the virtual switch interface and create a Standard Portgroup. It will ask you the name and VLAN ID and some other things, so you can create two Standard Portgroups, one with VLAN ID 30 and the other one with 40.
Take in consideration that if you need the VMs to keep connected after a host migration, the portgroup name must be exactly the same in every standard switch.
Here is how you do it: VMware Knowledge Base
Hope this solves your problem.
Regards!