Wow! I can't believe how similar your story is to my experience. Hang in there! It will get better!
I was planning a homebirth as well. Labored at home for ~24 hours, transferred to the hospital (while pushing) due to poor heart tones. Pushed for another 5 hours in the hospital, before finally pushing DD out. When DD was barely 24 hrs old the pediatrician and LC started pushing formula supplementation because my milk wasn't in yet and DD wasn't latching well.
DH finally told them that our ride was coming to pick us up at 4 and we were leaving. Yes, we would have signed DD out AMA if necessary. Pediatrician agreed to release DD when I told them I had found donor milk (which I never even used, my milk came in that night).
I spent the first two week, trying to get DD to latch, pumping round the clock and talking to a LLL leader. I was exhausted, frustrated, etc. I totally feel your pain.
Here's what helped me.
First, do whatever works if it will keep you breastfeeding. For me, I ended up using a nipple shield. It was the only way I could get DD to latch. period. Yes, I know they can hurt your supply and they can be hard to wean the LO off of. To me it was worth the risks, at least I would be able to feed my daughter, who at that point had lost 10% of her birth weight.
Second, night time is not the time to fight battles. Do whatever works and is easiest. If that means pumping and bottle feeding at night fine. Save working on her latch for the day time. If you want to try using a nipple shield only at night fine, if it help protect your poor nipples, try it. You can't work on improving things if you have had no sleep and are losing it. Make things easier and get a little sleep so you'll have the energy to put into working on breastfeeding during the day.
Third, get some breast shells. They'll protect your nipples when you're not feeding and help draw them out. I have flat nipples too. I had to wear the shells for 8 wks before my nipples poked out more and DD was big enough to help draw them out. Yeah, they're dorky looking, but its not like I was going anywhere. Oh and if you keep filling them up like I did, toss the stupid little sponges they come with and start stuffing them with baby wash clothes. Then you won't have to dump them out every 30 minutes.
It will get better! By 8 wks DD was completely weaned off of the nipple shield and latching well. It took about 2 weeks to transition her, but I took it really slowly and didn't push things. BF-ing is so much easier now at 4 months than I imagined it could be during those first hard weeks. And its so much easier than bottle feeding. I went back to work at 12 weeks. So I pump and DD gets my milk in bottles during the day. A total PITA to wash all those pump parts and bottles. I love, love, love the weekends when all I have to do is unhook my bra.
So hang in there. I did it. Other women have done it. Its hard, but you can do it too. PM me if you want to.