This kind of application are called OLE Server, you can use Delphi to
write such applications, but I suggest you use VC++ OLE Framework to
do this work, it's rather easy under VC++.
There is a sample OLE application called "Scribble", you can find it in
MSDN CD-ROM.