What is an accessory gearbox?
The accessory gearbox is generally driven by the N2 shaft (connecting the high-pressure turbine to the high-pressure compressor) and in turn drives the engine accessories such as generators, hydraulic pumps, oil pumps, etc.  The air turbine starter is also part of this gearbox so during starting the accessory gearbox drives the high-pressure compressor.  

This analogous to the serpentine belt on your car, which connects your crankshaft to your cars engine accessories (alternator, water pump, power steering, air conditioning, etc).