Sysinternals (acquired by Microsoft in July 2006) have lots of useful tools for examining how applications are interacting with the Windows OS.
A good example is the Process Explorer, which shows handles, DLLS and mapped files for all active processes. This is great for finding which process is locking that file that refuses to be deleted.