C library functions can be called directly from a C++ program. For example:
#include <math.h>
double foo(double value, int power)
{
double answer = pow(value, (double)power);
return answer;
}
The matlab documentation is the place to look for conversion functions.