Last summer, the senior developer on the Entity Designer team (Mike Kaufman) wrote a series of blog posts over on the ADO.NET team blog about how the designer uses the public APIs found in System.Data.Entity.Design.dll to do its model generation and code generation. He writes about the file formats used by the designer and the runtime, explains how EdmGen.exe uses these same APIs and talks about a project that he has on Code Gallery (EdmGen2) that is able to read and write EDMX files.
These are worth a read if you haven't seen them yet.