For a subversion of the whole Foundation concept, whether it was deliberately written as one or otherwise, try The Cosmic Computer by H. Beam Piper.
A few generations ago, the planet Poictesme was a major manufacturing depot and supply stockpile in a space war, which, once the war ended, left...