In general, this is a very hard thing to do.
The first thing you should do is understand how Java handle loading and unloading of classes. Take a look at the Java Language Specification, version 2, Section 12.7 "Unloading of Classes and Interfaces".
The short answer is: Before you can load/unload a class you need to instantiate your own class loader. You can then load the class. When you want to unload the class, you also have to unload the class loader used to load your class. After you have unloaded your class loader you can load another class loader, and then reload your class.