Cloth diapers - including flats, prefolds and inserts, made with natural fibers (i.e. cotton, bamboo, hemp, etc) naturally have oils on them that can have a repelling effect that make their absorbency less than optimal. Whether your new cloth diaper is completely natural or contains synthetic materials, it is a good idea to put them through the wash at least once before use. As you wash the diaper a few times, the material actually increasingly absorbent and will help prevent leaks. Organic, unbleached natural fibers (especially organic cotton) will require a few extra washes due to their higher oil content. Try to wash your cloth diapers made of natural fibbers separately to synthetic materials as the oils can wash onto those materials and build up to acquire a repelling effect as well.
Boiling your cloth diapers is an option, but I think it's safe to say that few of us have pots large enough to hold a few cloth diapers lying around in out kitchens! If you do choose to boil them, please note that diaper covers and anything else that is made with PUL, elastics or snaps should not be boiled. Since your diaper cover is not really doing the heavy duty absorbing, it's not really necessary to prep them, though you can still throw them in for a wash to clean off any dirt or chemicals that may have attached during manufacturing or delivery. Detergent is optional and a little will go a long way.
Cloth diaper laundry should ideally be done as frequently as every 1-3 days to keep things hygienic, prevent smells as well as staining.
Firstly, disposing of your baby's poop. As gross as this might sound, if your baby is exclusively breastfed (EBF) the stool is completely water soluble so you can throw the whole thing in the wash without rinsing. If you're not comfortable with the idea of this, you can always give your diaper a rinse before putting it into your pail or wet bag or throwing it in the wash. Once your baby starts on solids or formula, the poop will be slightly more solid and can be shaken directly into the toilet or rinsed off where it will be properly treated in the sceptic system before the diaper can be stored or washed. If you are using flushable or biodegradable liners, it should catch the poop such that both liner and stool can be lifted out of the diaper and disposed of into the toilet.
If possible, try keeping the load of laundry to contain dirty diapers only as you will want to avoid cross-contamination of bacteria and dirt from other clothing.
For detergent, you will want to choose one that is free of enzymes, dyes, synthetic fragrances, brighteners, softeners or bleach as they can cause irritation to your baby's skin or build up that will affect the absorbency and/or shape of the diaper. Many brands nowadays that advertise suitability for babies are natural and can be used with cloth diapers, but do read the fine print.
Your diaper shouldn't smell after washing, but if they do start to smell like ammonia and seem to be less absorbent after a few months, it may be time to strip them. Simply put them through a hot wash with about a tablespoon of an enzyme, fragrance and dye-free dish detergent (after all, they are made to fight through oils and grime!) or white vinegar and they should be good as new. Run it through a hot wash afterwards without detergent to rinse it thoroughly. Bleach and baking soda are best avoided as they can damage the PUL and elastics, but again, read the manufacturer's guidelines if in doubt.
Another tip - if you are lucky enough to get any direct sunlight in your home, drying your diapers under direct sunlight is the best way to prevent and get rid of stains!
Cloth diapers can be tumble dried or air dried on a rack, as you prefer.