You have to make sure you convert to FLAC (Free Lossless Audio Codec) directly from the uncompressed source material - once you convert to MP3, you've lost the quality and it doesn't matter if you then convert to a lossless format, you aren't getting the lost data back. It's called "transcoding", and becomes a problem if you get music online from untrustworthy sources.
For ripping from CD, I really like Exact Audio Copy.