In few words...
How to insert a class into an agent
or script library
Using a text editor, copy the class code to the Windows clipboard
Open the agent or script lib
Select Objects - (Options)
Paste the class code into the code pane
How to use a class
see Designer Help > IBM Domino Designer Basic User Guide and Reference
> LotusScript Language > User-Defined Data Types and Classes