The sample solution has 3 projects: one is a Custom Control Library that currently include 2 custom controls, both of them have UI Automation support buit-in; the 2nd is a WPF application that is using these 2 custom controls; the 3rd project is a tester to drive this WPF application using UI Automation APIs.   See the attachement for code download. 

Update: we have a updated solution, see attached, it includes external customer control with custom AutomationPeer, and an exteral test project.