you have to compile the c-code using the mex-function in matlab. if you compile the file on a windows system, it automatically has the extension .dll .
after that you can use the .dll if it was a regular matlab .m-function. The only difference as far as I know is, that it is not beeing compiled during execution.