Rambam Laws of Tefilin, Mezuzah, and Sefer Torah 1:13:
יג ספר תורה תפילין ומזוזות שכתבן מין, יישרפו. כתבן גוי, או ישראל משומד, או מוסר, או עבד, או אישה, או קטן--הרי אלו פסולין וייגנזו: שנאמר "וקשרתם . . . וכתבתם" (דברים ו,ח-ט; דברים יא,יח-כ)--כל שמוזהר על הקשירה ומאמין בה, הוא שכותב. נמצאו ביד מין ואין ידוע מי כתבן, ייגנזו; נמצאו ביד גוי, כשרים. ואין לוקחין ספרים תפילין ומזוזות מן הגויים ביתר על דמיהן, שלא להרגיל אותם לגונבם ולגוזלם.
A Torah scroll, Tefillin, or Mezuzah written by a heretic -- burn it!... If you find one in the possession of a heretic and don't know who wrote it, bury it; if in the possession of a non-Jew, assume it's kosher.
The question comes up with missionary Bibles -- there's a recent Rabbi Hershel Schachter mp3 where he says you can throw the whole thing out.
If you don't know whether the author was a heretic (he got a "D" in Heresy 101?) ... eh, ask a rabbi in each situation. Rabbi Moshe Feinstein addressed the question of how to approach music written by a man who had many vices -- Rav Moshe clarified he was still not deemed a "heretic."
Rabbi Shneur Lyman (in Tradition 2008) has a great piece concerning a letter from Rabbi Azriel Hildesheimer to someone cleaning out some old books -- he says "the one written by that fellow Frenkel who left the faith? Burn it, whatever!" Someone had mistaken this for Rabbi Zechariah Frankel , who had some ideas that would today be seen as on the borderline between Orthodox and Conservative. It turns out the letter concerned a fellow named Frenkel who had actually converted to Christianity and encouraged others to do the same.