I tend to think of classes as "function packs" for existing npcs, but here's an example of how they work. ( I assume that what's you don't understand. )
Class: example
PHP Code:
function randomClassFunc() {
echo("success!");
}
Then in your DB-NPC:
PHP Code:
function onCreated() {
join("example");
randomClassFunc(); // Would echo "success!" on NC.
}