You can write DLL's in C / C++ and link them into Mathcad,
See the mathcad help files <Developers reference> for most of the information that you need.
There are also a couple of example files to try.
For other languages, there is no documentation, but Viacheslav Mezentsev has created an excellent wrapper in C++ to communicate to other 'managed' languages (VB and C#)in the following link:
http://communities.ptc.com/thread/55228?tstart=0
regards
Andy