When I woke up, my family had come.

Literal

Eyes [obj-を] awaken [discovery-と], family [subj-が] had-come.

来ていた ('had come, were there') uses ~ていた for a resulting state discovered upon waking — the family arrived at some prior point and was present. Subject omitted for the waker.