If you can get 2-3 sprints of velocity, as DrewJordan recommends, this is hands down the best way. That being said, reality often finds us facing management who asks "When can you be done", before work has even started. If this happens, there is a method I learned from Agile Learning Labs that works well.
Caveat- To do this, you must do a full estimation of the backlog. If you are trying to estimate an entire year's worth of backlog, this won't be accurate. Nothing can estimate a year plus product well. It is still better than current models.
Step 1: Pick a reasonable release time frame. If you're doing agile, then you should be looking to release every three months at the most. If not, you lose a lot of the value of agile and will also find it hard to do agile when there is no real feedback coming in. This will also directly address the challenge of the Caveat listed above.
Step 2: Estimate the backlog. As mentioned in the Caveat, this needs to happen to be able to forecast a release date.
Step 3: Plan a theoretical first Sprint. Now this is not management assigns stories to a Sprint. This is honest to goodness team self-organized planning. Take the first story from the backlog and the team asks themselves, "Do we think we can get this done in the sprint (they are two weeks long, right? :) ). Then repeat this. Keep doing this until the team doesn't feel even close to comfortable that they can complete a story. This is KEY. If even one person thinks it can't be done, then stop and don't add the story. It is better to under estimate than over at this stage.
Step 4: Projection. Add up the story points of the sprint planning. Now divide the total story points in a release (remember, your goal is no more than about three months). At this point you have how many sprints it will take to complete the work. If that's more than three months of work, the release is probably too big and you should look at what is really needed.
Step 5 Reinforce this is a FORECAST. When you give the time estimate give it as "We have a 60% confidence in this schedule." Then follow this up with "After our first Sprint that should go up to 70% and after our second sprint 80%. By our third sprint we should have 90% confidence on either what our final ship date will be or what we will have done if the ship date must be fixed to a certain calendar point."
You'll never have more than 90% confidence, don't try. Mother nature and Murphy love to mess with anyone who says "I have 100% confidence".