Ok I did some testing. Not sure what you don't need, but here's how to get dwarves to train marksmanship with a crossbow:
Put a weapons rack, armour rack and coffer all next to each other and define all of htem as overlapping barracks. Set the crossbow squad to train there and set their squad equipment to be stored there too (not that I saw them use this but just in case). Also within that barracks, put in an archery target, make sure it's orientated in the right direction and with enough space (radius 3+) and that it too has T (training) and Q (squad equipment) activated.
Build crossbows - bear in mind a piece of equipment is not available for civilian jobs while it's assigned to a soldier even if that soldier isn't using it at present. Also build ammo but don't make ammo stockpiles - I couldn't get dwarves to use stockpiled ammo. In the military screen, you need to set their squad's authorisation ammunition. I've seen my crossbowdwarf use ammo even designated as combat-only for training so be wary. Your dwarves won't use ammo unless it's specifically assigned to their squad which you only have partial control over through that military screen. They don't know how to assign ammo that's in a stockpile in some bin. Incidentally, you can't stockpile just wood/bone bolts anyway as the materials section of stockpiles is bugged (lol silicous ooze bolts).
Oh and make sure you have quivers too, crossbowdwarves want to put their ammo in a quiver while they shoot. If dwarves get stuck in the "Go to Archery Practice" mode, temporarily give them some Move order and then cancel it - that'll refresh them (they are in a squad already so they're setup for squad orders).
Now that you get your dwarves to train their marksmanship... good luck getting them to actually use their honed skills in combat. All attempts I've made had them just run up to melee their targets after they loaded their bolts. But hey, now you can get your dwarves' skills trained up so that when a future patch fixes shooting, you already got your sharpshooters.