I don't know how safe this is but it works for me most of the time: In cases when attempts to safely eject the device does not work, I open Task Manager and terminate explorer.exe. I would then select the Applications tab and click on New Task, type in "explorer" (or explorer.exe) and hit OK.
Some people may not be aware that you can eject the device either by right-clicking or left-clicking on the icon, left-clicking being faster.
A tool I have not used recently, but which I think would also help is the free utility Unlocker which can be found here:
http://ccollomb.free.fr/unlocker/