hi just had same problem myself. also rev counter doing same thing, speedo sticks at about38 mph rev counter sticks about 1900 r/m. Checked all wires and sensors etc all intact and good signals coming to speedo/ rev counter head. Take instrument cluster out of dash and strip cluster(loads of x point screws around outside edge and hidden one in middle down a hole) gently ease two halves apart. On the back part of the cluster there is a metal clip that holds two pieces of flexi circuit board together take this off,(gently), you can now strip the hard circuit out of the back part of the cluster( held in by plastic legs about five) ease the pcb out and turn it over so you can see the back of it, now have a look at the circuit board where the pins for the speedo and rev counter are soldered to(magnifying glass recommended) and have a look for cracks around the pins on the solder, swift touch with soldering iron and remake the connections. This little beastie has been doing my head in for months dreaded mot prompted me into action rather than beating dashboard to death with a large mallet. We have had this problem on a few cars at work and one of our tech's (exBMW) says some bm's are prone to this!
Ash dcuk, April 2007