All you have to do calculate the number of teeth required is measure how far off your current speedo is, convert to percent, then get a new gear with the same percentage different teeth. Example:
Hold your speed at 60mph between 2 mile markers, it requires 54 seconds to travel the distance instead of 60 (you could also use a GPS to get your true speed). Your speedo is reading 10% low (your really going 66mph). In this case, if your current gear had 30 teeth you would need one with 27 teeth (10% less) to speed the speedo up.
I have also used this equation:
Number of Teeth = 259 * (axle ratio/tire diameter)