There's 2 ways this can be done.
The first way is to compile the different pieces (in different languages) into object files and link them. This only works for some languages and not others, and depends on the availability of suitable tools. For example, if one language does garbage collection you can't expect other languages to suddenly support it.
The other way is to build the application as separate processes that communicate/cooperate. This avoids the linking problem, but means that you've got separate processes (which can be "less clean") and serialisation/de-serialisation, etc.
Note: there is a third way, which is building an interpreter or something into the application to run scripting stuff. I'm not sure if this counts (it depends if you consider the scripts part of the application's code or part of the data the application uses at run-time).
Normally, nobody mixes languages without a good reason, because it's a pain in the neck for programmers. Most programmers know lots of languages but are only experts in a few, and the more languages you use the more chance there is that one or more programmers won't be able to comprehend one or more pieces of the application's source code.