Enter the following command in the MATLAB command window-
It has examples for C++ integration.
You can refer to the following link for more information- https://www.mathworks.com/help/simulink/sfg/s-function-examples.html
You can also use a MEX file to construct a new instance of the C++ object and return a pointer to it in MATLAB by encoding the pointer in an int64 matrix for example. Then you can pass this matrix back to the same or a different MEX file that will decode it and use it. You could use a MATLAB class to encapsulate the MEX files that use the C++ class and the encoding of the C++ pointer. A handle class destructor could be used to call a MEX file that deletes the C++ object.
An example of this approach can be found in the following file exchange link-
You can also use the legacy code tool to integrate C functions with MATLAB. Refer to the link mentioned below for more information-
But, the Legacy Code Tool can interface with C++ functions, but not C++ objects.