AFAIK, there was nothing in DCOP that automatically exposed functionality, and this old documentation seems to confirm it: https://techbase.kde.org/Development/Architecture/DCOP
I could be wrong but I believe the QWidget's that make up nearly every KDE app had DCOP built in to them.
It would have been hacky and questionable to incidentally expose application internals like that.
How it was apparently done was that eligible objects inherited DCOPObject, for which marshalling code was generated at build time using dcopidl2cpp.
https://api-staging.kde.org/legacy/3.0-api/classref/dcop/DCO...