The generator switch you are referring to is called a "break before make" switch. It "breaks" the connection between your house and the utility before it "makes" the connection between your generator and your house. Not only does it protect utility workers, but it also makes it impossible to feed both utility and generator power into your house at the same time (a VERY bad thing). And yes, you are correct: They are not cheap.
_________________________
"We are not allowed to stop thinking"