MP3 or FLAC lossless

Mediamonkey is the best solution I think. I don’t know if it has been updated to be compatible with the iphone since the 3.0 update, but it can sync with ipods and iphones, and auto-convert to your preferred format on sync.

Oh, it may also not be free for that level of functionality.

There’s a plugin for the Mac version (on xiph.org, maybe). Perhaps there is one for Windows also.