There is a command in the chdman (whatever) application for checking / creating the chd files. You take a harddrive and it will put it on the drive.
Search / Ask over at the main mame forums. Also might want to search at mameworld.net's forums.
But you can... and I believe its pretty easy. Not sure if you need specific drives or any IDE that the image can fit will work.