We did exactly this. 2013, at the trough of our local market, my wife and I (not even engaged at the time but we knew it was good) bought a property in a nice area. The main house is 2 levels plus an unfinished basement, 3 bed/2.5 bath. There is a detached 3-car garage, accessed by an alley, with a 1 bed/1 bath "carriage house" above.
We moved into the carriage house and rented the front. Without this setup, it would be a major financial stretch for us to have gotten into homeownership in this area. Initially, our net cost was about $100/mo, much lower than what we'd been paying in rent. It allowed us to save up rapidly.
We used those savings to buy a 2nd property across town, this one with a lock-off basement apartment. The original house and carriage house are both rented out. Rents have increased 66% for the front house - the property cash flows handsomely. I self-manage all 3 rentals now. It has allowed our wealth to explode, as we have significant retirement savings now, and savings ready to go into the next rental (or primary residence, likely with some type of lock-off), plus the home value is nearly double 2013 purchase price.
Appreciation and rent increases are not guaranteed. Make sure there is rental demand in your area (jobs, desirable place to be) and the numbers work, but I cannot recommend this enough.