OK, the "of object" works in my main app now too. My issue was that I was running that unit in Delphi mode (because I was too lazy to deref a bunch of pointers to records).
Just to be clear, in my example code, ClassA must be in objfpc mode, not delphi mode. It does not matter which mode ClassB is compiled under. And thats where I define the type with its rather strange "of object" qualifier.
I say strange because its not an object, its a class and the qualifier appears to apply to the return value not the function!

But I'm happy, its all working. Thanks Thaddy, Leledumbo, jamie and schuler !
When I first suggested 'we' move our project over to Pascal I was met with stunned silence. I was willing to contribute but it turned out I've done it all (with massive help from the lazarus community). I have already proved FPC/Lazarus is a better cross platform solution than the ungodly mixture of GTK+, Mono, C# that we have been using. And its fun to work with!
David