So...
There are virtual machines that basically run an operating system in some simulated environment (which might or might not correspond to the real hardware currently present). There are some possibilities to connect real hardware devices (e.g. USB drives) to a virtual machine.
Then there are some so-called "virtual USB devices" (e.g. the Arduino Leonardo) which can be programmed to respond like an actual USB device, but are basically just a micro chip at the other end of the USB cable that runs some program (they might or might not be connected to other components, for this question, let's assume they aren't).
Of course, one can connect a virtual USB device to a VM (as they are a piece of real hardware).
Would it be possible to skip the hardware part and run a custom program on the host operating system that connects to a virtual machine as if it were a real hardware device (say, as a plugin for the virtualization software, or using freestanding program using some API)?
If yes, are there any existing solutions for further reference?
If no, why don't virtual machines provide this capability (e.g. are there some hardware restrictions)?