Follow this link to unload dll:
http://www.codethesis.com/blog/unload-java-jni-dll
I tried it with my web application running on Tomcat, and it works!
Briefly, I call System.loadLibrary from the class which is loaded by my custom class loader using reflection. This class is then removed by garbage collector.