Sounds like the dentist has drilled into the pulp cavity or the dentine which will be too deep and that is what is causing the pain as those regions are innervated. The pain following a filling, once the anaesthetic has worn off should subside fairly quickly, if any at all. I would suggest revisiting the dentist pretty soon if the pain remains consistant, especially if it is aggravated by things such as cold/hot food. The filling will either need to be removed and possibly the tooth. The conservative method which can be applied is cutting the nerve for the tooth so you lose sensation, ie. root canal treatment.
Hope that helps.