That's how this is usually done. Create port groups with the required VLAN-ID's, add additional virtual network adapters to your VM, and assign these network adapters to the port groups. Please note that the maximum number of virtual NICs per VM is 10.
André