Little is known about the historical Dattatreya. He was probably a sadhu/yogi of the Shakta (Goddess-worshipping) branch of Hinduism and a precursor of Tantra. Legend credits him as being the teacher of Patanjali, the author of the famous Yoga Sutras, and various Tantrik orders claim him as their founder. He is held in particular esteem by the Adinatha school, who, in their Western guise, are now known as AMOOKOS. There is also a Dattatreya ashram in India. Echoes of Dattatreya can even be found in Bengali Islam, where he is known as Pir Tikkanath.
The main work attributed to Dattatreya is the Avhadhuta Upanishad, which describes the conditions of the liberated soul, one who is unfettered by dogma, habit, ritual or conventional morality. According to Dattatreya, the liberated one need not have any particular appearance, lifestyle, religion or social role. He/she may be a naked yogi or a prince, may appear pious or blasphemous, ascetic or hedonistic. The important thing is that, for the liberated soul, there is no "doer" of an action, and no beneficiary. One acts without thinking "this will give me pleasure" or "this is what I ought to do." This is similar to ideas found in other, apparently completely different, mystical traditions such as Sufism (c.f. Mevlana's comment that when we loose an arrow it is not us but God who shoots).
Because of this, Dattatreya is often regarded as antinomian, i.e. outside morality. He is often depicted as sitting naked in a cremation ground, embracing his shakti (goddess/female energy), drinking wine and eating pork (which is as abhorrent to Hindus as it is to Muslims or Jews). Nevertheless, followers of Dattatreya (such as the Nathas) normally adhere to the principle of ahimsa or non-violence, since a liberated soul would have no reason to harm others. Similarly there can be no egotism or selfishness, since there is no ego or self to experience these things. What Dattatreya, like other Tantriks, is opposed to is morality without function: the laws of religious or political dogma which are adhered to simply because they are there. Performing forbidden acts (like the cremation ground party) has a certain value in breaking taboos, but such acts in themselves have no value; the wine-drinker is not superior to the teetotaller, the lover is not superior to the celibate - or vice versa. For example, in this overly health-conscious age, there is a certain liberating value in smoking the occasional cigarette, but this doesn't mean that nicotine is good for you.
Dattatreya is usually depicted with three heads, symbolising Brahma/Shiva/Vishnu, past present and future, and the three states of consciousness: waking, dreaming and dreamless sleep. He is portrayed sitting in meditation with his shakti beneath the audumbara (wish-fulfilling) tree. In front of him is a fire pit, and around him are four dogs. These are sometimes said to symbolise the four Vedas, but since Tantra is outside the tradition of the Vedas, this symbolism is probably a later addition. In Tantrik meditation, the meditator mentally throws hunks of meat, symbolising ignorance, attachment, aversion and clinging to life, to the dogs, while the final piece of meat, symbolising ego, is thrown into the fire pit.
The word datta in Sanskrit means "gift" or "the act of giving" (the grammatical term "dative" comes from the same root). In Tantrik philosophy, all sense-impressions and experiences are gifts, which the liberated soul in turn gives back to the universe. Thus there is no reason to cling to anything, or to fear anything.