No example mission needed. Here's the line for you
"SoldierWB" createunit [getpos M2name, groupname, "M2gunner = this; M2gunner moveingunner M2name",0.3]
"SoldierWB" is the string name for a basic western soldier.
M2name is the name of the M2 the unit should mount.
groupname is the name of the group in which the unit will be created. Note that you can not create units without having an existing group on the map. If you want to you can later on use the [unitname] join grpnull to make him leave the group where he was created.
The commands inside the brackets are the units 'init line'. they will be executed once the unit is created.
0,3 is the skill of the unit. It can vary between 0 and 1, 1 being the most skilled.
you could also have "rank" after the skill command but that's not really necessary.
Createunit command is slightly more complicated than camcreate, because camcreated units are plain dummies and can't do nothing.
Look at reference of the Createunit command LDC posted and apply it to the example line I gave.