Before washing the cloth diapers in the washing machine let them soak in a detergent solution in a diaper pail.
Let the diapers soak for 24 hours if possible also try using some vinegar in the washing machine to help remove the urine smell from your cloth diapers.