You need an inverter designed for feeding electricity back into the grid, many of those available from alternative enegy specialists can do it. It needs to lock its phase with that of the grid and needs to have voltage and current control to prevent overload, as well as producing a decentish sine wave. You also need a system which will isolate the inverter from the grid, if the grid supply fails (you don't want engineers working on lines isolated from the grid getting electrocuted, nor do you want your inverter to try to power the whole city block).
A simple domestic inverter is a very simple device, with virtually no current and voltage control whatsoever, and will promptly fry if you try to use it to feed power into the grid.
The control system is quite complex, and while it is possible to build one, it will essentially mean redesigning the invertor from scratch. For what it would cost, you'd be best off buying one to do the job; however, they are far from cheap.
Bozz, you are quite right, if you supply current to the grid, then your electricity meter will turn backwards, and you will get 'paid' for the electricity you supply. Note though that if you supply more electricity than you use in a month (i.e. your meter reads less at the end of the month) then the electricity company tend only to pay up a piddling amount of cash (whereas if you supply less electricity than you use), you effectively get the full equivalent purchase price refunded.