When placing the turret on to the ship in some modeling proggie make sure the turret model's front points to the desired front vector (future fvec) direction and that the barrels are in 90 degree elevation (pointing along the desired up vector or uvec). Step 2.
Use whatever means possible to gather the data required to set up the fvec and uvec. There are utilities (like what Scooby posted, one hopefully soon to be released MAXscript or some other utility), or determine the vector by some other means (like using dummy objects with modeling program), or then by trial and error.Step 3.
Input the data to the subobject properties box when editing pof data (with for example PCS2). Most likely last entries of that particular subsystem.
Setup the animation code part of that subsystem entry in ships.tbl to what ever default you want the barrels to point to.