Just clarifying, is it the driveshaft (with the drive cogs in the track) or the jack shaft that the secondary bolts to?
For the driveshaft, as you mentioned, you need to take the chaincase apart, remove the gear, remove the bolts at the other side where the speedometer cable connects, then you likely have to remove the bearing on the clutch side (may need a cheap bearing puller) to get the shaft over enough to get it pulled away from the chaincase bearing to get it out.
Just remember how it all came apart for reassembly.
Similar process for the jack shaft (bolt needs to be removed from inside the chaincase), just should come out more easily once the clutch side bracket is unbolted.
ps. When putting back together, the bearing needs to be centered in the holder. You put this collar on last. It's a pain, but the way I do it is access from under the tunnel between the track and the tunnel, twist and then lock the collar on.
If you lock the bearing on and then put the whole drive shaft on, you risk slightly off-setting the bearing and it can pull or push to one side which will wear it out quick.
I've found that tunnels bend, and if you let the bearing float until you are done putting everything else back together, you're most likely going to put side-stress on the bearing, either by pushing or pulling.