Use the VMware Tools Configuration Utility to control removable devices from the command line in the guest operating system.
command in windows guest: VMwareToolboxCmd.exe
command in Mac OS X guest: vmware-tools-cli
command in Linux, FreeBSD, Solaris: vmware-toolbox-cmd
The required subcommands are "device enable/disable <device_name>".
The device name can be found using the "device list" subcommands.
With a script containing the required command, you can also connect and disconnect the devices from the command line in the host using "vmrun [...] runProgramInGuest [...] <path_to_script>".