Call Mathematica functions from C++

There are several possible ways discussed in detail here:

http://mathematica.stackexchange.com/questions/8438/minimal-effort-method-for-integrating-c-functions-into-mathematica

There are more LibraryLink examples here:

Once you are familiar with LibraryLink, you might want to take a look at my package, LTemplate, which makes it much quicker to build complex LibraryLink applications:

http://mathematica.stackexchange.com/questions/96127/how-to-simplify-writing-librarylink-code