Multiply the points you earn per grade (A = 4, B = 3, C = 2, D = 1) by the number of units per class, then divide by the total number of units.
So, if you're getting an A in a 3-unit class, a B in a 3-unit class, a B in a 4-unit class, and a D in a 1-unit class, your GPA would be [(4*3) + (3*3) + (3*4) + (1*1)]/4 = 3.1
Note that + or - grades usually correspond to decimal values. (A B+ might give you 3.3 points, for instance.)