An alternative way of calling a method on a MATLAB object is this:
returnedValue = methodName(object,args,...)
So, transferred to my CMEX file:
mxArray *plhs[1];
mexCallMATLAB(1, plhs, 0, NULL, "getAnObject");
mxArray *params[2];
params[0] = plhs[0];
params[1] = mxCreateDoubleScalar(12);
mexCallMATLAB(0, NULL, 2, params, "aFunction");
Have a nice day!