Automation and event listening in Lazarus/FreePascal

Does anyone have any experience of hooking up an event listener for Calc in Lazarus/FreePascal? I managed to get this working in Delphi many years ago, but I cannot port the code directly to Lazarus, as the underlying implementations of TAutoObject and TComServer are slightly different, and FPC has no implementations of the IConnectionPoints/IConnectionPoint interfaces.

I can start an instance of Calc and load a document successfully, but I don’t know how to create an event listener. Any help appreciated.

var libreMgr, libreDsk, libreDoc: OleVariant;

libreMgr := CreateOleObject('com.sun.star.ServiceManager');
libreDsk := libreMgr.createInstance('com.sun.star.frame.Desktop');

libreDoc := LibreDsk.loadComponentFromUrl(etc...);

libreDoc.addEventListener(????);