Fillings can and do often hurt for several months after you have them. Think of it this way you had a high speed (and perhaps low speed) drill pounding away on your tooth into the living tissue of it. This will cause tissue injury and hydrostatic pressure differences which will result in a much more sensitive tooth. The ONLY sensation a tooth can feel is pain. If its cold, it hurts, if its hot, it hurts, if its inflamed a bit, it will hurt.
This WILL go away with time. Sometimes a short time sometimes a long time. It took me about 3 months to be 100% ok with my fillings I had last year.