Every so often when I try to safely remove a USB drive from my Windows machine I get the Problem Ejecting USB Mass Storage Device error even though I'm sure no programs are using the drive.
Microsoft suggests using a free program to fix this - Process Explorer (from a company called 'Sysinternals' that was purchased by Microsoft a few years back). Once you've downloaded the software it is a simple enough process, but does have the potential to make you system unstable, so make sure you understand the risks before continuing through this quick tutorial.
I'm going to run through an example of the brief details provided by Microsoft itself on their Support site at http://support.microsoft.com/kb/555665 which is a bit out of date, as it doesn't mention the fact that the latest version of the utility is available at http://technet.microsoft.com/en-ca/sysinternals/bb896653.aspx Verify that you're really on the Microsoft site, then download the program and install it and get it running.
This is a very powerful program and could certainly make your system unstable, so I recommend saving your data in all running programs, and even closing down as much as possible, just in case.
Try one more time to safely remove the USB hardware, and I assume you'll get the error message: The device 'Generic volume' cannot be stopped right now. Try stopping the device again later.
If Process Explorer isn't already showing the open handles in the lower pane, press CTRL-H. You're ready to run a search in the Find menu item under Handle or DLL substring
Enter the drive letter of the USB drive you're trying to stop, followed by a colon and slash, such as e:\
Click the search button which will show you the one or more Process IDs of the programs that still have a connection to the USB drive.
As you click on each item in the search results, the lower pane of the main window will update to show you the the process in the lower Handles pane. Right click the item in the lower pane of the main window, and select Close Handle from the drop down menu.
Note that this is a rather low level operation that you're doing, but if you're sure no programs should be accessing the drive anymore, select the Yes button on the Continue with close? dialog.
Once this completes, try stopping the USB device again normally and all should work. If not, repeat the above.