HI
I use a 30A relay as a change over. The moving contacts go to the house, the normally closed contacts go to the grid. The normally open contacts go to the inverter, the armature winding go to the inverter, when the inverter is on it pulls the contactor in and connects the house to it. In the event of the battery going down or the inverter failing the system drops to the grid automaticaly. You have to switch the live (hot) and neutral conductors to make sure there is no chance of the inverter feeding the grid. This would most likely destroy the inverter but it makes sure your not back feeding up some poor electrical engineers fingers.....
Hope this helps, also make sure your relay, cable type and size is suitable for the voltage and power.
Brian.