The character of Bartleby connects to the theme of hopelessness that the story explores. He at first is an ideal scrivener in the eyes of the lawyer, but then he shuts downs. Rather than do what he is told, he tells his employer "I prefer not to."
At the end of the story, the lawyer learns that Bartleby worked in the dead letter office in Washington, D.C. There he dealt with all the letters that tragically never arrived to their recipients. The lawyer surmises that dealing with failed communications day in and day out depressed Bartleby and made him so hopeless that doing anything came to seem pointless.
Melville does use literary devices to get his point across. The lawyer's offices reinforce Bartleby's sense of hopelessness. They are on the second story of a building around which tall structures have grown up, so that there is not much sunlight and no views. Bartleby stares from his desk at a blank wall three feet away, a fitting symbol of a hopelessness. This reinforces that he is cut off from any vision or vista of a better future.
Bartleby is associated with walls throughout the story. Also, the prison where he is sent is called the Tombs, the name underscoring the extent to which he feels closed in and without hope. Further, Bartleby repeats the words "I prefer not to," a phrase of apathy and hopelessness, so often that it becomes associated with him as a key part of his character.