I normally declare an interface base class, use this declaration in my application, then use LoadLibrary, GetProcAddress to get the factory function. The factor always returns pointer of the interface type.
Here is a practical example, exporting an MFC document/view from a DLL, dynamically loaded