I attached my GPS to my handlebars and went riding, stopping about every 10-15 miles to compare distances and changing the cyclocomputer's setting a tad up or a tad down each time, until I got the two to agree.
Another thing you can do is map your route using a mapping program on your computer (or an online source like Mapquest), then ride the route and compare mileages. I would suspect this would be fairly accurate over a 20-30 mile span.