The basic idea behind bank switching is that the NES can only "see" 64KB of memory at once (32KB, really, since that's where the cartridge is.) So, by writing values "to" the cartridge, you can provide different "windows" into a larger space to have the game run. (Another name for this in programming is "memory overlays" - you may have some luck if you search for that.)
iNES mappers 2 and 3 have the easiest forms of bankswitching to implement, so those would be good tests for basic bankswitching code. (Gradius uses mapper 3, Life Force uses mapper 2.)
I'm haven't developed for a bankswitching mapper yet, but those who have may be more helpful than I.