I thought everything in flash would get erased once the device is rebooted.
No. Everything in RAM will be erased when you reboot, flash doesn't require power to keep its contents intact.
How do I remove useless stuff from flash?
I'm current using 64-0 image and a 512MB SD card. I thought that was the way I had to go if I had a large SD card like I do.
Yes, this is the way to go, just just have to make sure you install stuff to sd.
Also note that there's not much free space on the 5500, so things like the package lists take up valuable space. There's a thread around here explaining how to change where these lists are stored (they can be stored in /var which is a temporary RAM-disk) by making an alteration to /etc/ipkg.conf
As to removing useless stuff, perhaps by removing the package lists (as they are rather large). Iirc, they live somewhere under /usr/lib/ipkg/ though as I don't have my Z with me atm I can't tell you exactly, nor exactly what they will be called (don't go mad deleting stuff in there though as if you do ipkg will not be happy).
Edit: 'lists_dir ext /path/to/more/storage' is the line to add to ipkg.conf
Si