You can use the CloseHandle api function to release an object. Unfortunately (for you) CloseHandle works only inside the process that is calling it so you have to inject the closing code into the process that is locking the file.

I usually use the CreateRemoteThread method to execute my code in other processes so may want to research that. If not, there is a .net dll that will do the work for you; here is the google translation (scroll to bottom for sample code).