When I arrived my husband prepared dinner.( he started when i arrived)
When I arrived my husband had prepared dinner.( dinner was ready)
Gdy przyszłam, mój mąż przygotował obiad.
Zanim przyszłam, mój mąż przygotował obiad.
Some people would also say (for the latter):
Gdy przyszłam, mój mąż miał już przygotowany obiad.
but I'm not sure if this is a correct construction, since it looks more like a borrowing from German or English. However it's quite common in my area (west Poland).
Cinek