It's very easy, if you want an example just have a look at the Ogre engine source code, there's a very simple class (with macros for each OS) which does this job.
Basically, the functions to call are :
- LoadLibrary, GetProcAddress, FreeLibrary on Windows
- dlopen, dlsym, dlclose on Linux (not 100% sure of the names)
- no idea on MacOs