If the VMs not need to communicate outside their own Vlans, not putting a router, or no gateway configuration as recommended previous could be the solution. If they need to communicate outside while restricting between the two Vlans, there could be two solutions:
First is to use host firewalls on VMs, linuxand windows have firewall, but this would be difficult to manage and orchestrate the rules and ensure that the firewall is enabled and running on each VM.
Another solution could be to use Access Control Lists(ACL) on the router. This feature could be used with as
deny ip Subnet_VlanA to Subnet_VlanB
deny ip Subnet_VlanB to Subnet_VlanA
permit ip Subnet_VlanA to any
permit ip Subnet_VlanB to any
and applying this ACL to the routers VlanA and VlanB interfaces. Since there is single place to configure, this could be simpler.
If the VMs were on the same subnet, the same could be achived by using Private Vlans with Isolated VlanA and Isolated VlanB which belong to Primary VlanC. Private Vlans are supported with dVS ( Distributed Virtual Switch):
These links could be helpful
https://www.vladan.fr/private-vlans-vmware-vsphere/
VMware Knowledge Base
VMware Knowledge Base