Unfortunately they are normally coded to the key, which means either you need to find someone/autoelectrician with VAGCOM, or tow the car for a painful trip to the dealers.
The first option obviously being the cheaper one, but ask for a full diagnostic scan first to highlight any more simple fixes.
FYI - whenever changing a car's battery you should try to keep a small amount of voltage in the system ~6V to keep the ECU alive and stop it resetting. Common mistake, but causes a right pain when it goes wrong.