There are a lot of ways to do this, the easiest way I've found is as follow.
First divide your front gear (lets say 14)t by the rear gear (lets say 45t) to come up with a ratio.
14/45 = 0.31
Then take the known top speed at that gear ratio(lets say 30)and divide it by that ratio to come up with a Kfactor (constant) for your engine set-up.
30/0.31 = 96.43
Now you can figure out what top speed are achievable with different gear ratios.
First figure out the new ratio, lets say you want to switch to a 40t rear.
14/40 = 0.35
So then you take that new ratio and multiple it by the Kfactor for your engine.
0.35*96.43 = 33.8
So in theory a bike that did 30 with 14/45 gearing will be able to do 33.8 with 14/40 gearing.
Hope that helps.