Beartooth and Chief Joseph Highway are GREAT roads. You can do a nice loop out of Cody and catch them both.
https://goo.gl/maps/6i9a37LvfAm
A bit of warning....it can be very cold at the top of Beartooth. It's not uncommon for them to still be renting snowmobiles at the top in June. The roads are also obviously twisty mountain roads so if you or your co-rider are worried about heights, it may be something you need to research a bit more.
Assuming you're ok with a bit of cold and high twisty, it's a breathtakingly beautiful ride and the road is a lot of fun as well.
You can go left where Chief Joseph meets Beartooth and there's a little town there called Cooke-City / Silver Gate. If you keep going, you'll end up in Yellowstone.
I've ridden through Yellowstone twice now and it's not bad, but it's really slow going and I believe the best part of Yellowstone isn't on the bike but hiking off the road a bit and seeing stuff. I wear full gear, so stopping and looking at stuff every few miles gets to be tedious. I've decided that I'd like to go back and do Yellowstone with a rental car and hiking boots the next time.
So...it's worth riding through, just expect to be in a fair amount of traffic and you'll have to stop and walk a bit to see the best stuff. And...as others have mentioned, the traffic builds in the day and on the weekends so early morning mid week is your best bet to minimize the traffic.
Grand Tetons are beautiful by bike. Traffic isn't too bad except for the easiest way there from Cody is going through the SE corner of Yellowstone. It would be a fairly long ride from Cody to Grand Tetons and back in a day. The miles aren't that much, but it will take quite a few hours. Jackson, WY is a neat town if you want to do an overnight but it's VERY expensive to get a hotel there. I think I paid $190 a night for a Motel 6 room one year. Completely nuts.
Anyway....hope this helps. Definitely take the bike as the area is beautiful to ride in.