If you don't mind using some of Wy's well maintained secondary roads, here is my route.
From Spearfish, head W on I90 to Gillette, exit south on Wy59 to Wright. In Wright change to Wy 387 SW to Edgarton/Midwest where you can either jump on I25 via 387, or continue south on the 2 lane 259 to hit I25 further south. Then south to Casper where you exit onto 220/789/287 to I80 W at Rawlins.
Those back roads are all good, but watch out for the many antelope that graze in the grasslands right along the roadways.
Jim