Keep the head tilted back – never forward as gravity will work to drain the intraocular fluid.  Do not put any pressure on the eye.  Ideally you would like to gently tape a small cup, like a Dixie cup, over the eye.  If the object is protruding from the eye (like a nail), do not attempt to remove it.  Go to the nearest emergency room, calling ahead if possible to tell them what has happened and to please alert their on-call ophthalmologist.  This is obviously an ocular emergency.