I wrote a tutorial on matlab+cuda using mex files a few years ago:http://faculty.washington.edu/dushaw/ep ... l_2_10.pdf
A little dated, but I think it is still valid, generally.
Matlab's parallel processing toolbox has mostly superseded my laborious mex files, however. But it is nice to have the mex file approach working, just in case.
Also, matlab may have its own cuda libraries internally. One issue that has come up is a user's mex file may try to use these libraries first, rather than the expected libraries from cuda. One can test which libraries are used by doing >> !ldd usersmexfile.mex from within matlab. Perhaps matlab has sorted this issue out by now, however. (assuming linux as the OS here)