In the USA we often associate capitalism with freedom and democracy and communism with authoritarianism and repression. Was there ever a democratic communist state, or conversely, a totalitarian capitalist state?
Terms like "free" "democratic" "totalitarian" and "capitalist" are (generally) pretty meaningless - you could make a strong case that the US' use of the electoral college system means it's not truly democratic, or that every modern western country's various social welfare system means they are not proper capitalist societies.
That said, the two examples that immediately jump to mind are:
The Indian state of Kerala: the Communist Party of Kerala has been elected to government a number of times since Indian independence (first in 1957). The Communist party continued to allow free elections, and has won and lost a number of those elections over the past 60 years.
Facist Spain: Franco's Spain, particularly after the economic liberalisation that began in the mid to late 1950's with the Stabilisation Plan, was both a totalitarian state, and "capitalist" (given the ordinary use of the word) - a market economy, decreasing levels of government intervention and protection, encouragement of foreign trade, etc.
Just to make it easier for others to answer, you might want to be more specific about what "democratic" and "totalitarian" mean in this context, exactly.