I have had the opportunity to use a few technologies for mixing and matching programs written in different programming languages in the last month: CORBA, SOAP, and the simple XML over HTTP (i.e., REST like RPC).
More thoughts on using multiple programming languages
Sure, it is a hassle using RPC compared to building large monolithic applications, but I find that not only are different programming languages best for some tasks, but often key utility libraries are available only for some languages.
While I really like CORBA, and I have CORBA support in Java and Smalltalk, other languages which I find useful like Common LISP and Prolog either don't have CORBA support, or it is expensive.
Although not a perfect solution, I keep coming back to writing HTTP servers that use URL encoding to specify a "function name" and arguments - usually returning an XML payload makes sense.
In principle, SOAP is a better way to go, but XML over HTTP is much easier to implement.