We're sorry to hear of your miscarriage.
If you were to spot or flow prior to immersing in the mikveh, then you would make a hefsek taharah on the day of the spotting and begin a new set of seven clean days the night of the next Hebrew day. You would not be required to wait the five days.
Please note that immersion is permissible on Rosh HaShanah. Although some authorities advise against relations on Rosh HaShanah, this advice is not a prohibition and does not apply when Rosh HaShanah is the night of immersion. Please let us know if you would like our help in working out logistics for immersing on Rosh HaShanah.
Also, in order to avoid becoming niddah unnecessarily, please review our article on stains, ketamim. Note that you should change to colored underwear as soon as you finish your seven clean days, even if your immersion will be delayed for a few days.
Shanah tovah!