not sure if everything's been cleared up yet, but essentially what the guys have been trying to say is that in the formula: a.b = |a||b|cos(theta), the 'theta' is the angle made by the two vectors when you put their 'tails' together. so basically, the 'theta' in this case isn't angle B (since then you are taking the angle between the 'head' of vector a and the 'tail' of vector b), but the supplementary angle (picture moving vector a so that it's tail coincides with the tail of vector b. recall that you can 'move' normal vectors around and it will still remain the same vector). hence a.b = |a||b|cos(pi - theta) = -|a||b|cos(theta), with theta = angle B.
also, the geometric proof that dc302 alluded to is worth probing in order to consolidate your understanding of the cosine rule. (hint: try drawing the altitude of the triangle and do some trig off that). if i'm not mistaken, i think this particular proof is in your textbook.