Rainn Wilson will star as his Office character Dwight Schrute in the spinoff, which will centre on Dwight working as a beet farmer.
According to The Hollywood Reporter Middleditch will play Jeb Schrute, a successful marijuana farmer and Dwight's younger brother.
Best known for his work on College Humour, Middleditch was most recently seen in Will Ferrel's The Campaign.
Roswell actress Majandra Delfino has also been cast as Dwight's sister, Frannie.
The Office is set to end after its upcoming ninth season, which premieres September 20 on NBC.