Let's say you are 3 handed and people have the following stacks:
The prize pool is $50 for 1st, $30 for 2nd and $20 for 3rd. The way ICM works is your chance of getting 1st is just your % of chips in play, so the 10k stack has a 1/6 chance of getting 1st, 20k has a 1/3 chance and 30k has a 1/2 chance.
Since all players are getting at least $20 even if they bust right now, their equity for first is their chance to get 1st at this time, multiplied by the extra amount they'd get if they won vs busting right now. So the 10k stack's equity for 1st is 1/6 multiplied by $30, or $5. The 20k stack is $10 and the 30k stack is $15.
Now comes the harder part, determining each stack's equity for 2nd place. This is done by figuring out the chance of getting 2nd if you assume another player gets 1st. For example, we would find the chances of the 30k stack getting 2nd by figuring out his equity when the 10k stack gets 1st and when the 20k stack gets 1st. If the 20k stack gets 1st, the remaining chips at this time are 40k (the 30k stack and the 10k stack), so he has a 3/4 chance of getting 2nd in that scenario. If they 10k stack gets 1st, the remaining chips at this time are 50k, so the 30k stack has a 3/5 chance of getting 2nd.
However, now we need to use the chances of each of those other stacks getting 1st to determine the likelihood of each scenario. The 10k stack only gets 1st 1/6 of the time at this point, so we multiply 1/6 (the 10k stack's chance of getting 1st) by 3/5 (the chance the 30k stack has of getting 2nd when the 10k stack gets 1st) by $10 (the pay jump from the current $20 payout to 2nd place money of $30). This gives us a solution of $1. Now we do the same with the 20k stack getting first, so the calculation is 1/3 (the 20k stack's chance of getting 1st) by 3/4 (the 30k stacks chance of 2nd if the 20k stack wins) by $10. This gives us a solution of $2.50. So now we add up all of our solutions plus the $20 current payout if he busts, giving the 30k stack an equity of $38.50 ($20 + $15 + $1 + $2.50).
You could do the same calculation's to find the ICM equity of the other players as well. It's comparatively simple to do this for 3 players, but every player you add just makes the calculations more and more complicated. For example, if you do this for 4 players you have to first figure out each player's chance of getting 1st, then you have to figure out the equity of each player getting 2nd when each other player gets not only 1st, but also 3rd and 4th.
Rather than make these calculations myself, I use an ICM calculator such as this one: http://www.icmpoker.com/Calculator.aspx