if you're using Windows, (you can skip directly to step
3. if using a recent versions of Calibre, it now support importing chm files directly).
1. extract the HTML files from the CHM container from the command prompt with HH.EXE
HH.EXE -decompile C:\Temp\decompile-folder C:\Temp\yourCHM.chm
(Mac users can use Tubby to convert CHM to HTML)
2. merge the HTML files into a single file (e.g. with SoftSnow Merger)
3. use Calibre to convert it to EPUB.
all programs mentioned above are freeware, hh.exe is a Microsoft Windows Help utility.
there are commercial programs like ABC Amber CHM Converter that will perform steps 1 & 2 automatically. however, i don't know any software that will convert CHM directly to EPUB. other commercial applications (e.g. Universal Document Converter) can be used to convert CHM to PDF which the Kindle may or may not handle all that well.