Many places sell a $200 item used to connect a generator to the fuse box. It protects the generator from commercial power. You can only have one feeding the house. either commercial power or the generator, not both. This device isolates the sources from one another and automatically kicks off the auxiliary power when the commercial power returns.
Otherwise, you could design a manual device. Brian Woods had discussed how he did it manually using a spare breaker. However, you have to be careful to turn off the auxiliary before turning on the main. Also, I dont know how you would know when commercial power is restored this way?
If your generator is small like mine (2000 watt) you don't want to connect to the box. Simply outfit the furnace with a main recepticle box and plug. Then during an outage, you can plug the furnace, frig, and some lights into the generator. If you have a 5kw or larger generator, then you can wire into the fuse box. Even with 5kw, you will be able to overload it.