On the voip.ms side, make sure the trunk is setup as "Asterisk, IP PBX, Gateway or VoIP Switch" and the outbound CallerID Number is blank. That way the caller ID coming from the PBX will be passed through (must be a 10 digit number).
On the 3CX, I am not sure what you have to do since I don't use it