In DB use make mesh from object command ...like this you can manipulate origin of object which DB use for placing and rotating. then use offset limb command to get it to right position.
make object box 1,1,1,1
make object box 2,0.5,2,0.5
position object 2,0,-2,0
make mesh from object 2,2
delete object 2
add limb 2,1,2
offset limb 2,1,0,-0.5,0...try to rottate limb 2 of object 1 and you see what it did
center of space (coordinate 0,0,0) is used like origin of mesh when useing make mesh rom object command so position your barel or what ever, that 0,0,0 is where you want to have origin of your barrel rottation.
look here for example of such a manipulation while building model made of limbs:
http://darkbasic.thegamecreators.com/?m=forum_view&t=8590&b=10&p=0 its DB code
But if you use Milkshape you just need to learn to make skeleton of joints for your model and attach your limbs to joints and its done

place one joint in centre of tank chasis, then second at the bottom of your turret where tarret would rottate and third at the begining of your barrel. Than attach barrel to third joint, turret to second and rest of your model to firsth one ...export to .x and your rottation will work fine.