In Entity-Framework, you can create a DB schema, and then generate your ORM classes. Is there any software that does this in reverse? For example you create a few classes that have relationships, and software generates a database schema with the relevant primary and foreign key relationships?
Yes, it is available in EF starting from version EF 4.1.
You can do it with Entity Framework, using Code First.
EF 4.3 even has Migrations built-in.
I've done this with DataNucleus/JDO, with Derby as the underlying database engine. It works, but you have to be ever so careful when doing it because effectively your classes are the schema and need to be subject to the usual level of carefulness with schema management.
I'm not sure I'd do it the same way again if I was starting out afresh.