Well, let the wild mass guessing begin: (spoiler from the ending ahead, dont read if you havent watched the ending)
Did homura used all her magical power and madoka appeared to cleam her soul gem? Or did she just remembered madoka and imagined her?
Also is she on a post apocalyptic world, maybe she is just to far in the future, or simply in a random desert?
My personal answer are: She lived for a long long time defeating the new manifestation of the curses, and ultimately consumed all her magical power, this causes madoka to appear, hug her and cleanse her soul gem so she can rest now.