Here is a good example on how to read the Dallas DS1821.It is written by Denis Bernard.
Download source code in an04.zip