The basic formula converts a poll into a probability. The probabilities from the set of polls for a state are averaged, giving more weight to recent polls. The final weighted average probabilities for each of the states are used in Monte Carlo simulations of the election. The probability of winning the election is the count of simulations where the candidate won 270 or more Electoral College votes divided by the total number of simulations.
This is essentially the same thing that Nate Silver at 538 does.
-PJ