I'll use the IBM XT (ibm5160 driver) as a reference ...
You should have some floppy boot disk images ready that contain the relevant DOS tools (FDISK and FORMAT).
You will also need to have the MAME tools compiled, specifically CHDMAN.
Then create a 20MB HD image called "test.chd" (or whatever) using
chdman createhd -o test.chd -chd 615,4,17
The newly created HD image is equivalent to mounting a Seagate ST225 MFM harddisk in your physical PC.
start your emulation with
(Your executable could also be called mame64 or a 32 bit variant, but you already have floppy loading running, so you know what to use)
Then SCRLCK-TAB into the internal menu, go to file manager and load test.chd in the hard disk controller, your bootable DOS installation disk in the floppy drive and reset the emulation.
The emulated PC-XT should boot from the floppy. Then you can use FDISK to create a partition, reboot and format it with "FORMAT c: /s".
Once that is done remember to remove your floppy disk image from the drive and reset - voila!
The harddisk can be specified from the command line:
mess64 ibm5160 -hard1 test.chd
but you might have to add the path to the harddisk file (for test purposes this was just created in the same directory where the MAME executable resides).
If you are using a different machine than IBM XT / ibm5160 you might find that you have to add a hard disk controller in one of the ISA slots (SCRLCK-TAB, Slots) or that the machine still has some quirks. Please tell us about your experiences!