Thanks for that link too, that is more about doing opposite though, calling C++ classes from Delphi, instead of letting C++ call Delphi code.
Writing that kind of stuff manually for big APIs is lots of work though, ideally it should be done either via a preprocessing tool or even better, if someone could add direct support for that in FPC...