Loop filter coefficients are well explained in J G Proakis and Salehi book on Digital Communications, see chapter for carrier and phase estimation. A theoretical optimization is very well explained on the basis of filter coefficients for loop filter.
Mostly one need zero, first or 2nd order low pass (which adds pole)filter to maintain the stability...
Get the filter coefficients based on your loop requirement...
Implement the filter using block diagram form using delay elements in MATLAB simulink or you can write a simple difference equation based on coefficients....