In DLL you can use class as in every normal application problems will appear when you will try to export it from DLL or import in DLL.
Can you explain to me the example? 
This is quite complicated matter and it only works for the simplest of classes. The problem is that DLL and mainapplication currently have their own copies of all state (class registrations, RTTI etc) , and operators like IS don't work on classes from "the other side".
The wiki page on Packages (
http://wiki.freepascal.org/packages ) lists some of this.
In general, I advise to stay away from DLLs as much as possible unless you know what you are doing.