Read the source code for Pascal for Delphi from RemObjects. It takes A LOT of assembly code and thunking to do it properly, but it can be done. One thing that helps, limit down the calling structure of your methods (IE: Don't support CDECL and the others, only support PASCAL methods).