At the start of Mass Effect, David Anderson is Captain of the Alliance’s prototype frigate, Normandy. Following Shepard's appointment as humanity's first Spectre, Anderson is forced into retirement in order to give command of the Normandy over to Shepard. When the Normandy is grounded later in the game, Captain Anderson helps Shepard regain control and escape from the Citadel. At the end of the game, players can choose to appoint him as humanity's representative on the Council if they saved the Council, or as head of a new Council if they let them die.
Mass Effect 2
Anderson plays little part in the second Mass Effect. The Council regards Shepard as a renegade and refuses to grant him any help regardless of the players actions in the previous game. However, during a side quest to appraise the council of Shepard's new mission the player can engage Anderson in dialogue that will differ depending on how you treated him in the first Mass Effect.
Mass Effect 3
During the events leading up to Mass Effect 3, he's resigned his role as human representative of the council and retaken his commission for the Systems Alliance as an Admiral.
Anderson has been a character featured to different degrees in the Mass Effect novels, including the upcoming fourth novel preluding to Mass Effect 3. The first book, Revelations, told the story of how Anderson's chance to become a SPECTRE was taken away from him and the third book, Retribution, continues after ME2, where he takes on Cerberus. The thread between the two books and the second novel - Mass Effect: Ascension - is Kahlee Sanders, an Alliance scientist and Anderson's love interest.