Shower before a ride. It helps with clothes getting smelly, saddle sores forming (less bacteria to start the party) and so on and so forth.
I have a small dedicated hamper for cycling/triathlon kit and try to wash it as soon as possible. Some guys I know rinse their kit in the shower after a ride.
If your kit has absorbed the smell, it's probably beyond saving. Better materials do seem to be more resistant to starting to smell, I have some free dry-fit running shirts which you get on various races and they are far more prone to starting to smell than quality triathlon kit.
I wash all the kit in the washing machine on the default sportswear setting and hang in the sun to dry.