The easy way is to replace the /framework and /app folders into a working hero port, though problems could ensue due to differenced in libraries, so merging /lib is also a good idea.
Personally, I'd like to know what every file does and which lib apps depend on. The builds I've made before usually contain unused libraries that I don't remove because I don't know where they're needed and proper documentation is not available outside the source.
What I think you need to do is take the build, then merge the HTC provided proprietaries, and then use the rest of the libs with their corresponding boot.img (as they're created during compilation and depend on that particular kernel)
Again, I really wish I knew what all libs do (I think I know about 30% of them on a stock build)
Best reference thread ever: Learn to compile your own AOSP build
(for sapphire, but applies to dream too)