I also saw a bunch of YC companies started by foreign (non-US) founders take advantage of deep networks at home.
MIT alumni companies also recruit pretty heavily from MIT even if they move to SFBA, etc. I assume other college alumni networks are the same way.
US C-Corp or the likes which is owned by the shareholders. Then C-Corp owns 100% of the shares of the company of subsidiary (depending on jurisdiction there maybe legal limitations imposed). Then there is usually an 'agreement' where all IP generated by sub. is owned by parent company, and parent company pays X to sub. company for services (which are usually 100% match to the expenses). Sub. company hires and manages the employees and deals with local taxes, etc.
This of course, depends on size of the companies (both parent and subsidiary) and countries and then there are a bunch of agreements to make sure everything is above board, but pretty much works this way.
source: just had a friend's company that went through doing that, having a Delaware parent company and a subsidiary setup in Portugal.
Later, open an engineering office in your "home" location to take advantage of non-SV hiring possibilities. You can get started on this in a limited way by contracting work back "home", especially for non-core functions.