The carbonyl C is numbered 1 C because of has higher priority. Thus, you would count going down. The highest numbered Carbon refers to the one with the highest value, as with your example of D-Threose, it is the 3rd Carbon right before the CH2OH. You don't count the CH2OH because it is not chiral. So D refers to dextrarotary meaning right which the OH group IS on the right. And the L-Threose has the OH group on the left, levarotary.