I'm prepping for the IR check ride and the 172 I regularly fly has a wild DG, it has to be reset to the compass every 5 mins. The DG is so unreliable that when given a heading I track the heading on the GPS instead of holding the heading on the DG. Even with a working DG you could have a wide spread between your track and your heading in a cross wind. That's a long way to ask: when flying IFR do you follow the assigned heading or track the assigned heading? My gut says fly the assigned heading and ATC will vector to compensate for wind.