This is sort of like working in a lab with toxic chemicals. There is a way to work and wear certain special clothes so you don't get contaminated. Likewise, I wonder if when dealing with malware you can still use the source/infected machines for their functionality, even though they are infected, and still not get infected on the target device when connecting via USB.
I'm wondering because I don't yet know how to think about the directional flow of code in terms of what device can install something on what other devices it can connect to. I'm not sure what pieces there are to take into account. So it seems that if you knew that A would infect anything it's plugged into, but that B wouldn't let any traffic out except a specific acceptable kind, then you could plug A into B, B would get infected but still allow connection to C without C getting infected. That sort of thing.