Here you can find a reverse engineering tool, and a documentation on how to use it. At present only MSSQL is fully supported, but should be easy to provide strategies for other DB. The project is open source and can be found here in the trunk.This tool does not generate classes, to do so you can use hbm2net. The generated files are a good starting point if you have to start with NHibernate and legacy DBs.