The simple part is the proper treatment on the books of both entities. You could, for example, treat it as a loan from OldCo to NewCo; in such case OldCo books a Note Receivable and NewCo puts a Note Payable onto its balance sheet. If you go this route the standard caveat applies: document the transaction in the corporate minutes as a bona fide loan, and create a promissory note with reasonable terms as to interest, payback, etc.
That, however, doesn't address the complexities that might surround the situation, the existence and nature of which will be very case-specific. Just as one example, it's possible (very much depending on the whole picture) that the taxing authorities might see your transfer of the cash from OldCo to NewCo, concurrent with your set-up of NewCo, as being instead a dividend distribution to you from OldCo followed immediately by a contribution of the cash by you to NewCo for stock. Similarly, any distribution from a company which is clearly into shut-down mode might, despite being treated on your books as a loan, be recharacterized either by the tax agency or in court as a liquidating distribution.
On another angle, there can be unpleasant issues in the situation of extracting assets from OldCo in such a way that OldCo is left insolvent (assets < outside debt).
Obviously, these and other similar possibilities can only be assessed by an advisor (accountant or attorney) who has all the pertinent details in front of him. Have a tax-experienced accountant give it a look, and if OldCo has outstanding debt still present, have an attorney give it a peek as well.
As a side note, if the magnitude of the situation warrants, you might consider a statutory merger of OldCo into NewCo. Depending on the applicable laws of your area, a merger might accomplish the objective of getting OldCo's cash onto NewCo's balance sheet automatically, and possibly without an immediate tax consequence.